package com.kpf.springcloud.controller;

import com.kpf.springcloud.common.ResultJson;
import com.kpf.springcloud.pojo.KpfTopic;
import com.kpf.springcloud.pojo.PageResult;
import com.kpf.springcloud.service.FeignClientUserServer;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author shiwen
 * @date 2021/3/8
 */
@RestController
@Api(value = "收藏相关接口", description = "收藏相关接口") //swagger接口配置
public class CollectConsumerController {

    @Autowired
    private FeignClientUserServer feignClientUserServer;

    @PostMapping("/consumer/collect/collectTopic")
    public ResultJson collectTopic(@RequestParam(value = "topicId") int topicId, @RequestParam(value = "collectStatus") int collectStatus) {
        return feignClientUserServer.collectTopic(topicId, collectStatus);
    }

    @GetMapping("/consumer/collect/getCollectListByUserId")
    public ResultJson<List<KpfTopic>> getCollectListByUserId() {
        return feignClientUserServer.getCollectListByUserId();
    }

}